<include file="./Application/Admin/View/Public/htmlheader.html"/>
<include file="./Application/Admin/View/Public/header.html"/>
<include file="./Application/Admin/View/Public/left.html"/>

<ol class="breadcrumb">
    <li><a href="/Admin">首页</a></li>
    <li class="active">题库列表</li>
</ol>
<div class="row">
    <div class="col-lg-12">
        <div class="table-responsive">
            <table class="table table-hover table-bordered">
                <tr class="success">
                    <th>标题</th>
                    <th>选项1</th>
                    <th>选项2</th>
                    <th>选项3</th>
                    <th>选项4</th>
                    <th>正确答案</th>
                    <th>分值</th>
                    <th>操作</th>
                </tr>
                <volist name="list" id="vo" empty="暂时没有数据">
                    <tr>
                        <td>{$vo.title}</td>
                        <td>{$vo.option1}</td>
                        <td>{$vo.option2}</td>
                        <td>{$vo.option3}</td>
                        <td>{$vo.option4}</td>
                        <td>选项{$vo.answer}</td>
                        <td>{$vo.score}</td>

                        <td>
                            <if condition="$permission['questionEdit'] eq TRUE">
                                <a href="__ROOT__/Admin/Question/questionEdit?id={$vo['id']}"
                                   class="btn btn-info btn-xs">编辑</a>
                            </if>
                            <if condition="$permission['questionDel'] eq TRUE">
                                <a href="__ROOT__/Admin/Question/questionDel?id={$vo['id']}"
                                   onclick="return confirm('确定删除?');" class="btn btn-danger btn-xs">删除</a>
                            </if>
                        </td>
                    </tr>
                </volist>
            </table>
            <div class="row">
                <div class="col-lg-3">
                    <if condition="$permission['questionAdd'] eq TRUE">
                        <button class="btn btn-primary" data-toggle="modal" data-target="#addRoom">题库添加</button>
                    </if>
                </div>
                <div class="col-lg-9 text-center">
                    <nav>{$page}</nav>
                </div>
            </div>

        </div>
    </div>
</div>
<!--   添加题库 弹出层   -->
<div class="modal fade" id="addRoom" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span></button>
                <h4 class="modal-title" id="myModalLabel">添加题库</h4>
            </div>
            <form action="__ROOT__/Admin/Question/questionAdd" method="post" enctype="multipart/form-data">
                <div class="modal-body">
                    <div class="row">
                        <div class="col-lg-3 text-right"><p><span class="red">*</span>图片：</p></div>
                        <div class="col-lg-6"><input type="file" name="image" class="form-control"/></div>
                    </div>
                    <br/>

                    <div class="row">
                        <div class="col-lg-3 text-right"><p>标签：</p></div>
                        <div class="col-lg-9">
                            <select name="tagId" class="form-control">
                                <foreach name="tagList" item="vo">
                                    <option value="{$vo.id}">{$vo.name}</option>
                                </foreach>
                            </select>
                        </div>
                    </div>
                    <br/>

                    <div class="row">
                        <div class="col-lg-3 text-right"><p>题库名称：</p></div>
                        <div class="col-lg-9"><input type="text" name="title" value="" class="form-control"/></div>
                    </div>
                    <br/>

                    <div class="row">
                        <div class="col-lg-3 text-right"><p>选项1：</p></div>
                        <div class="col-lg-9"><input type="text" name="option1" value="" class="form-control"/></div>
                    </div>
                    <br/>

                    <div class="row">
                        <div class="col-lg-3 text-right"><p>选项2：</p></div>
                        <div class="col-lg-9"><input type="text" name="option2" value="" class="form-control"/></div>
                    </div>
                    <br/>

                    <div class="row">
                        <div class="col-lg-3 text-right"><p>选项3：</p></div>
                        <div class="col-lg-9"><input type="text" name="option3" value="" class="form-control"/></div>
                    </div>
                    <br/>

                    <div class="row">
                        <div class="col-lg-3 text-right"><p>选项4：</p></div>
                        <div class="col-lg-9"><input type="text" name="option4" value="" class="form-control"/></div>
                    </div>
                    <br/>

                    <div class="row">
                        <div class="col-lg-3 text-right"><p>正确答案：</p></div>
                        <div class="col-lg-9">
                            <select name="answer" class="form-control">
                                <option value="1">选项1</option>
                                <option value="2">选项2</option>
                                <option value="3">选项3</option>
                                <option value="4">选项4</option>
                            </select>
                        </div>
                    </div>
                    <br/>

                    <div class="row">
                        <div class="col-lg-3 text-right"><p>分值：</p></div>
                        <div class="col-lg-9"><input type="text" name="score" value="" class="form-control"/></div>
                    </div>
                    <br/>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                    <button type="submit" class="btn btn-primary">添加</button>
                </div>
            </form>
        </div>
    </div>
</div>
<include file="./Application/Admin/View/Public/footer.html"/>